#ifndef MATRIX2D_H
#define MATRIX2D_H

#include "Vector2D.h"

namespace SolidityEngine{

class Matrix2D
{
    float _a11,_a12,_a21,_a22;

    public:
        Matrix2D();
        ~Matrix2D();
        Matrix2D(float e11,float e12, float e21, float e22);
        Matrix2D(const Vector2D& top, const Vector2D& bottom);
        Matrix2D(float[4]);

        float& Xx();
        float Xx() const;

        float& Xy();
        float Xy() const;

        float& Yx();
        float Yx() const;

        float& Yy();
        float Yy() const;

        float Det() const;

        Matrix2D operator+(const Matrix2D& mat) const;
        Matrix2D operator-(const Matrix2D& mat) const;
        Matrix2D operator*(const Matrix2D& mat) const;
        Vector2D operator*(const Vector2D& vec) const;
        Matrix2D operator*(float val) const;

        static Matrix2D Identity();
        static Matrix2D Rotation(float angle);

        Matrix2D Normalized() const;
        void Normalize();

        Matrix2D Inverse() const;
        void Invert();

        bool operator!=(const Matrix2D& rhs) const;
        bool operator==(const Matrix2D& rhs) const;


    protected:
    private:
};

Matrix2D operator*(float val, const Matrix2D& mat);
Vector2D operator*(const Vector2D& vec, const Matrix2D& mat);

}
#endif // MATRIX2D_H
